package com.springbootsecuritydemo.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.springbootsecuritydemo.entity.UserEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @author Daft_V
 * @date 2022/4/6 11:53
 */
@Mapper
public interface UserMapper extends BaseMapper<UserEntity> {

    /**
     * 根据用户名查询用户
     *
     * @param username 用户名
     * @return UserEntity
     */
    @Select("select * from user where username=#{username} and is_active='1'")
    UserEntity queryUserList(@Param("username") String username);
}
